#include "bank.h"

int main() {
    Account user;
    int choice;
    double amount;

    // 初始化账户
    init_account(&user, "6228481234567890", "张三", 1000.0);
    printf("欢迎使用简易银行系统！\n");

    // 操作菜单
    do {
        printf("\n请选择操作：\n");
        printf("1. 存款\n");
        printf("2. 取款\n");
        printf("3. 查询余额\n");
        printf("4. 显示账户信息\n");
        printf("0. 退出\n");
        printf("请输入选项：");
        scanf("%d", &choice);

        switch (choice) {
            case 1:
                printf("请输入存款金额：");
                scanf("%lf", &amount);
                deposit(&user, amount);
                break;
            case 2:
                printf("请输入取款金额：");
                scanf("%lf", &amount);
                withdraw(&user, amount);
                break;
            case 3:
                printf("当前余额：%.2f\n", check_balance(&user));
                break;
            case 4:
                show_account(&user);
                break;
            case 0:
                printf("感谢使用，再见！\n");
                break;
            default:
                printf("无效选项，请重新输入！\n");
        }
    } while (choice != 0);

    return 0;
}